// 设置默认样式
@bg-color: #b7d4a8;

// 清除默认样式
* {
   margin: 0;
   padding: 0;
   box-sizing: border-box;
}

body {
   font: bold 20px "Courier";
}

// 设置主窗口的样式
.main {
   width: 360px;
   height: 420px;
   background-color: @bg-color;
   margin: 100px auto;
   border: 10px solid black;
   border-radius: 20px;
   display: flex;
   flex-direction: column;
   align-items: center;
   justify-content: space-around;

   // 设置舞台样式
   .stage {
      width: 304px;
      height: 304px;
      border: 2px solid black;
      position: relative;

      // 设置蛇的样式
      .snake {
         &>div {
            width: 10px;
            height: 10px;
            background-color: black;
            border: 1px solid @bg-color;
            // 开启绝对定位
            position: absolute;
         }
      }

      // 设置食物的样式
      .food {
         width: 10px;
         height: 10px;
         position: absolute;
         top: 40px;
         left: 40px;
         display: flex;
         flex-wrap: wrap;
         justify-content: space-between;
         align-content: space-between;

         &>div {
            width: 4px;
            height: 4px;
            background-color: black;
            transform: rotate(45deg);
         }
      }
   }

   // 设置记分牌样式
   .score-panel {
      width: 300px;
      display: flex;
      justify-content: space-between;
   }
}